package com.zhang.service;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class DeleteStyle {

    private static final String regEx = " style='(.*?)'";
    private static final String regEx2 = " style=\"([\\s\\S]*?)\"";

    public String removeContentStyle(String content) {

        Pattern p = Pattern.compile(regEx);
        Matcher m = p.matcher(content);
        if (m.find()) {
            content = m.replaceAll("");
        }

        Pattern p2 = Pattern.compile(regEx2);
        Matcher m2 = p2.matcher(content);
        if (m2.find()) {
            content = m2.replaceAll("");
        }

        return content;
    }
}